<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>斜线</title>
    <style type="text/css">
        .box{width:100px; height:40px; background:pink; position:relative; overflow:hidden;}
        .out{
            border-top:40px blue solid;/*上边框宽度等于表格第一行行高*/
            border-left:100px transparent solid;/*左边框宽度等于表格第一行第一格宽度*/
            position:absolute;
            left:0; top:0;
        }
        .out2{
            border-top:40px pink solid;/*上边框宽度等于表格第一行行高*/
            border-left:100px transparent solid;/*左边框宽度等于表格第一行第一格宽度*/
            position:absolute;
            left:0; top:-1px;
        }
    </style>
</head>

<body>
<div class="box">
    <span class="out"></span>
    <span class="out2"></span>
</div>
</body>
</html>
